package com.bilibili.privatetry;

public class student {
    String name ;
    private int age ;
    private double height ;
    private double weight ;

    public student(){

    }

    public void setAge(int age) {
        if(age>0&&age<30){
            this.age = age;
        }
        else {
            System.out.println("请重新输入");
        }
    }

    public int getAge() {
        return age;
    }

    public void setHeight(double height) {
        if(height>0&&height<2){
            this.height = height;
        }
        else {
            System.out.println("请重新输入");
        }
    }

    public double getHeight() {
        return height;
    }

    public void setWeight(double weight) {
        if(weight>30&&weight<100){
            this.weight = weight;
        }
        else {
            System.out.println("请重新输入");
        }
    }

    public double getWeight() {
        return weight;
    }
}
